﻿using CloudSail.Exam.InfrastructureDto.Response.ResultDto;
using CloudSail.Exam.Service.Instance;
using Main.Common;
using Main.Extend;
using Main.Extend.Attributes;
using Main.Server;
using Microsoft.Extensions.Configuration;

namespace Main.Service
{
    [Provider, Inject]
    public class PhoneCodeService : ApiResultService
    {
        private SendCode _SendCode;

        public PhoneCodeService(BaseServer baseServer, IConfiguration configuration, SendCode sendCode) : base(baseServer, configuration)
        {
            _SendCode = sendCode;
        }

        public ApiResult GetPhoneCode(string Phone, string Code)
        {




          


            // 判断过期时间
            // 一分钟内一条
            // 一小时内 五条
            // 一天内 十条
            // 添加至数据库
            // 返回值为 OK 字符串大写 即为成功
            _SendCode.SendPhoneCode(Phone, Code);

            return Ok();

        }


    }
}
